package cpm.lc.securitydemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @RequestMapping("/admin/hello")
    public String admin(){
        return "要具有ADMIN权限才能访问！";
    }
    @RequestMapping("/user/hello")
    public String toUser(){
        return "要具有ADMIN或USER权限才能访问！";
    }
    @RequestMapping("/db/hello")
    public String dba(){
        return "要具有ROOT或DBA权限才能访问！";
    }
    @RequestMapping("/hello")
    public String toHello(){
        return "这是一个SpringSecurity项目，你能看见这段文字说明你已经通过认证了！";
    }


}
